import 'dart:math';
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:game_11_sleep_game11/values.dart';

class Tile {
  int key;
  Rect new_rect;
  Rect old_rect;
  int level;
  int image_id;
  bool show_flag;
  double speed = 0.1;
  double angle;
  late AnimationController clear_controller;
  late AnimationController scale_controller;
  late Animation<double> clear_animation;

  Tile(this.key, this.new_rect, this.old_rect,
      {this.level = 0, this.image_id = 0, this.show_flag = true, this.angle = 0});

  String get get_image {
    return image_dic[image_id]!;
  }

  Tile get tile_copy {
    return Tile(
      key,
      new_rect,
      old_rect,
      image_id: image_id,
      level: level,
      show_flag: show_flag,
      angle: Random().nextDouble() * 361,
    )..scale_controller = scale_controller..clear_animation = clear_animation..clear_controller = clear_controller;
  }
}
